---@diagnostic disable: lowercase-global, undefined-global, trailing-space

local select_unit_brain = require('core_alpha_rts/brains/select_unit_brain')

---@type data_keyhandler[]
local data = {
    {
        namespace = 'alpha_rts',
        skillid = 'spawn_mob',
        type = 'down',
        key = 'KEY_H',
        skill_template_type = 'none',
        client_rpc_data = function (player)
            local x,_,z = ConsoleWorldPosition():Get()
            return x,z
        end,
        fn = function (player, x, z)
            if x and z then
                local mob = SpawnPrefab('spider')
                mob.Transform:SetPosition(x,0,z)
                mob:SetBrain(select_unit_brain)
                if mob.components.combat then
                    mob.components.combat.min_attack_period = 0.2
                end
            end
        end
    }
}


return data